<!--{template /module/admin/view/head}-->
<div id="left_layout">
	<div id="main_content" class="container-fluid">
		<!--{template /module/admin/view/head_nav}-->
		<div class="row-fluid">
			<form method="post" action="{$ADMIN_SCRIPT}/user/message/_add" onsubmit="javascript:return check_form(this);">
			<input type="hidden" name="formsubmit" value="yes" />
				<div class="well widget">
					<div class="widget-header">
						<p class="text">* {lang admin.validate.require}</p>
					</div>
					<div class="widget-content">
					<fieldset>
						<label>{lang user.message_edit.view.username.label}</label>
						<input type="text" class="input-xlarge" name="txtUserName" placeholder="{lang user.message_edit.view.username.placeholder}" maxlength="30"/> 
						<span class="help-inline">{lang user.message_edit.view.username.tips}</span>
						
						<label>{lang user.message_edit.view.type.label} *</label>
						<label class="checkbox inline">
							<input class="fancy" name="rdoType"type="radio" value="0" checked="checked"/> {lang user.message_edit.view.type.radio.0}
						</label>
						<!--{if $setting['ThirdSMTP']}-->
						<label class="checkbox inline">
							<input class="fancy" name="rdoType" type="radio" value="1"/> {lang user.message_edit.view.type.radio.1}
						</label>
						<!--{/if}-->
						<!--{if $setting['ThirdSms']}-->
						<label class="checkbox inline">
							<input class="fancy" name="rdoType" type="radio" value="2"/> {lang user.message_edit.view.type.radio.2}
						</label>
						<!--{/if}-->
						<!--{if $wx_setting['WX_OPEN'] && $wx_setting['WX_MSGTPL']}-->
						<label class="checkbox inline">
							<input class="fancy" name="rdoType" type="radio" value="3"/> {lang user.message_edit.view.type.radio.3}
						</label>
						<!--{/if}-->
						<span class="help-inline">{lang user.message_edit.view.type.tips}</span>
						
						<hr/>
						<label>{lang user.message_edit.view.title.label} *</label>
						<input type="text" class="input-xlarge" name="txtTitle" placeholder="{lang user.message_edit.view.title.placeholder}" maxlength="50" /> 
						<span class="help-inline">{lang user.message_edit.view.title.tips}</span>
						
						<label>{lang user.message_edit.view.message.label} *</label>
						<textarea class="span6" cols="45" rows="4" name="txtMessage"></textarea><br/>
						<span class="help-inline">{lang user.message_edit.view.message.tips}</span>
						
						<hr />
						<button type="submit"  name="btnSubmit" id="btnSubmit" class="btn btn-small btn-primary" {$dispatches[operations][add]}>{lang admin.operation.submit}</button>
						<button type="reset" class="btn btn-small">{lang admin.operation.reset}</button>
						<button type="button" class="btn btn-small" onclick="javascript:location.href='{$ADMIN_SCRIPT}/user/message';">{lang admin.operation.go.back}</button>
					</fieldset>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>

<script>
function check_form(frm){
	if(frm.txtTitle.value.trim().length == 0){
    	$(frm.txtTitle).next('.help-inline').css('color', 'red');
    	frm.txtTitle.focus();
    	return false;
    }
    
    if(frm.txtMessage.value.trim().length == 0){
    	$(frm.txtMessage).next('.help-inline').css('color', 'red');
    	frm.txtMessage.focus();
    	return false;
    }
    
    return true;
}

$(function() {
	$('.fancy').uniform();

	$('fieldset input,textarea,select').blur(function() {
		$(this).next('.help-inline').css('color', '#333');
	});
});
</script>
<!--{template /module/admin/view/foot}-->